const http = require('http');
const express = require('express');
const Config = require("../node_modules_ext/config.js");

const { SOFTWARE } = Config;

const StaticServer = {};

StaticServer.run = (port) => {
    const app = express();
    app.use(express.static(SOFTWARE.appDir));
    const httpServer = http.createServer(app);
    httpServer.listen(port);
    console.log('Static服务器正在运行 [端口 - ' + port + ', http]...');
    StaticServer.server = httpServer;
}

module.exports = StaticServer;